﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace zichan.Models
{
    public class OldPutawayModel
    {

        /// <summary>
        /// 服务器上架及机柜列表
        /// </summary>

        [Key]
        public int Id { get; set; }
        [Required(ErrorMessage = "机房不能为空")]
        public int MachineRoomId { get; set; }
        [NotMapped]
        public string MachineRoomName { get; set; }
        [Required(ErrorMessage = "机柜不能为空")]
        public int CabinetId { get; set; }
        [NotMapped]
        public string CabinetName { get; set; }
        /// <summary>
        /// 标准机架数
        /// </summary>
        [NotMapped]
        public int StandardNumber { get; set; }
        /// <summary>
        /// 剩余机架数
        /// </summary>
        //[NotMapped]
        //public int Surplus { get; set; }
        [Required(ErrorMessage = "公司不能为空")]
        public int CompanyId { get; set; }
        [NotMapped]
        public string CompanyName { get; set; }
        [Required(ErrorMessage = "用途不能为空")]
        public int PurposeId { get; set; }
        [NotMapped]
        public string PurposeName { get; set; }
        //[Required(ErrorMessage = "编码不能为空")]
        public string Code { get; set; }
        //[Required(ErrorMessage = "服务器不能为空")]
        //public int? ServerId { get; set; }
        [Required(ErrorMessage = "资产名称不为空")]
        public string Name { get; set; }
        [Required(ErrorMessage = "占位不能为空")]
        [RegularExpression(@"^\+?[1-9]\d*$", ErrorMessage = "占位必须大于0")]
        public int UseNumber { get; set; }
        [Required(ErrorMessage = "序列号不能为空")]
        public string SerialNumber { get; set; }
        [Required(ErrorMessage = "IP不能为空")]
        public int IPId { get; set; }
        /// <summary>
        /// 服务器用途
        /// </summary>
        [Required(ErrorMessage = "服务器用途不能为空")]
        public int serverPurposeId { get; set; }
       
        [NotMapped]
        public string serverPurposeName { get; set; }
        /// <summary>
        /// 服务器用途类别
        /// </summary>
        [Required(ErrorMessage = "服务器用途类别不能为空")]
        public int serverPurposeSubId { get; set; }
        [NotMapped]
        public string serverPurposeSubName { get; set; }
        [Required(ErrorMessage = "使用人不能为空")]
        public int UserId { get; set; }
        [NotMapped]
        public string IP { get; set; }
        public string SubIPIds { get; set; }
        [NotMapped]
        public string SubIP { get; set; }
        [NotMapped]
        public string[] SubIPId { get; set; }
        /// <summary>
        /// 内网ip
        /// </summary>
        public string IntranetIP { get; set; }
        /// <summary>
        /// 是否反解
        /// </summary>
        public bool IsInverse { get; set; }
        /// <summary>
        /// 上架备注
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        /// 下架备注
        /// </summary>
        public string RemoveRemark { get; set; }
        /// <summary>
        /// 空位/剩余机架数
        /// </summary>
        public int? Vacancy { get; set; }
        //public int Statu { get; set; }
        //[NotMapped]
        //public string StatuName { get; set; }
        //public DateTime putAwayTime { get; set; }
        //public DateTime CabinetUploadTime { get; set; }
        ///// <summary>
        ///// 0为无产权，1为有产权
        ///// </summary>
        ////public int? Equity { get; set; }
        ///// <summary>
        ///// 有值，则为该机柜架被使用过，只能报废
        ///// </summary>
        //public int? IsUsed { get; set; }
        /// <summary>
        /// 租用产权
        /// </summary>
        public string Property { get; set; }
        /// <summary>
        /// 托管产权
        /// </summary>
        public string TProperty { get; set; }
        /// <summary>
        ///专用于服务器资产标识
        /// </summary>
        public string Identitys { get; set; }
    }
}